﻿using SeeSharpTools.JY.GUI;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SeeSharpTools.Demo.GUI
{
    public partial class FormString : UIPage
    {
        public FormString()
        {
            InitializeComponent();
            comboBox_ledMarixStyle.Items.AddRange(Enum.GetNames(typeof(LedSyle)));
            comboBox_ledMarixStyle.SelectedIndex = 0;
        }

        private void numericUpDown_ssNumOfChar_ValueChanged(object sender, EventArgs e)
        {
            sevenSegment1.NumberOfChars = (int)numericUpDown_ssNumOfChar.Value;
        }

        private void textBox_ssText_TextChanged(object sender, EventArgs e)
        {
            sevenSegment1.Value = textBox_ssText.Text;
        }

        private void numericUpDown_ssbNumOfChar_ValueChanged(object sender, EventArgs e)
        {
            segmentBright1.NumberOfChars = (int)numericUpDown_ssbNumOfChar.Value;
        }

        private void checkBox_highLight_CheckedChanged(object sender, EventArgs e)
        {
            segmentBright1.IsHighlightShow = checkBox_highLight.Checked;
        }

        private void checkBox_backgroundGradient_CheckedChanged(object sender, EventArgs e)
        {
            segmentBright1.IsBackgroundGradient = checkBox_backgroundGradient.Checked;
        }

        private void chkRToL_CheckedChanged(object sender, EventArgs e)
        {
            if (chkRToL.Checked)
                scrollingText1.ScrollDirection = ScrollingText.TextDirection.RightToLeft;
        }

        private void chkBounce_CheckedChanged(object sender, EventArgs e)
        {
            if (chkBounce.Checked)
                scrollingText1.ScrollDirection = ScrollingText.TextDirection.Bouncing;
        }

        private void chkLToR_CheckedChanged(object sender, EventArgs e)
        {
            if (chkLToR.Checked)
                scrollingText1.ScrollDirection = ScrollingText.TextDirection.LeftToRight;
        }

        private void textBox_ledMatrix_TextChanged(object sender, EventArgs e)
        {
            ledMatrixContol1.AddTextItem(textBox_ledMatrix.Text, new Point(0, 0), LedMatrixItemDirection.Right, LedMatrixItemSpeed.Fast);
        }

        private void comboBox_ledMarixStyle_SelectedIndexChanged(object sender, EventArgs e)
        {
            ledMatrixContol1.LedStyle = (LedSyle)Enum.Parse(typeof(LedSyle), comboBox_ledMarixStyle.Text);
        }
    }
}
